package com.link2room.aeriabots.controller.api;


import com.link2room.aeriabots.dto.param.base.WxJspSignParamDto;
import com.link2room.aeriabots.dto.result.api.WxJspSignApiDto;
import com.link2room.aeriabots.facade.IWxOfficialAccountsMenuFacadeService;
import com.link2room.common.dto.result.base.BaseResultDto;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 微信jspSign签名 用于支付公众号支付 config
 * Created by LN on 2016/9/20.
 */
@RestController
@RequestMapping("/api/WxJspSigns")
public class WxJsSignApiContoller {
    @Resource
    private IWxOfficialAccountsMenuFacadeService wxOfficialAccountsMenuFacadeService;
    @RequestMapping(method = RequestMethod.POST)
    public BaseResultDto getJspSign(
            @RequestBody WxJspSignParamDto paramDto
    ) throws Exception {
        WxJspSignApiDto dto = wxOfficialAccountsMenuFacadeService.requestWxJsSignDto(paramDto);
        BaseResultDto res = new BaseResultDto();
        res.setResultCode(0);
        res.setResultInfo(dto);
        return res;
    }
}
